package com.observer.gsj20150607;

public class CurrentDisplay implements Observer,Display{

	private float temperature;
	private float pressure;
	private Subject weatherData;
	
	public CurrentDisplay(Subject weatherData){
		this.weatherData = weatherData;
		weatherData.registerObservers(this);
	}

	@Override
	public void display() {
		System.out.println("tem:"+temperature+" "+"pre:"+pressure);
	}

	@Override
	public void update(float temperature, float pressure) {
		this.temperature = temperature;
		this.pressure = pressure;
		display();
	}

}
